package tani.bnn.com.mbilling.core;

import java.sql.Date;
import java.util.Comparator;

import tani.bnn.com.mbilling.utility.DateUtils;

public class QuantityPriceDetail implements Comparator<QuantityPriceDetail>{
	private int	profitLoss;
	private int	quantity;
	private	int	price;
	private Date sopDate;
	private String sopDateString;

	private String type;

	/**
	 * @return the profitLoss
	 */
	public int getProfitLoss() {
		return profitLoss;
	}

	/**
	 * @param profitLoss the profitLoss to set
	 */
	public void setProfitLoss(int profitLoss) {
		this.profitLoss = profitLoss;
	}

	/**
	 * @return the quantity
	 */
	public int getQuantity() {
		return quantity;
	}
	/**
	 * @param quantity the quantity to set
	 */
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	/**
	 * @return the price
	 */
	public int getPrice() {
		return price;
	}
	/**
	 * @param price the price to set
	 */
	public void setPrice(int price) {
		this.price = price;
	}
	@Override
	public int compare(QuantityPriceDetail arg0, QuantityPriceDetail arg1) {
		return arg0.getPrice() - arg1.getPrice();
	}
	public int compare(ProductPurchaseDetail arg0, ProductPurchaseDetail arg1) {
		// TODO Auto-generated method stub
		return 0;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the sopDate
	 */
	public Date getSopDate() {
		return sopDate;
	}

	/**
	 * @param sopDate the sopDate to set
	 */
	public void setSopDate(Date sopDate) {
		this.sopDate = sopDate;
		setSopDateString(DateUtils.formattedDate(sopDate, DateUtils.DATE_MONTH_FORMAT));
	}

	/**
	 * @return the sopDateString
	 */
	public String getSopDateString() {
		return sopDateString;
	}

	/**
	 * @param sopDateString the sopDateString to set
	 */
	public void setSopDateString(String sopDateString) {
		this.sopDateString = sopDateString;
	}
}
